#include <iostream>

using namespace std;

int main(){
	int n,t,flag;
	cin >> n;
	for(int i= 1;i<=n;i++){
		cin >> t;
		flag = 0;
		for(int j = 2;j < t;j++){
			if(t % j == 0){
				flag = 1;
				break;
			}
		}
		if(!flag){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	} 
	return 0;
}

